﻿
using CSharpLibs.Annotations;

#pragma warning disable 0169

namespace System
{
	[Builtin]
	public struct SByte : ISignIntegralValue, IComparable, IComparable<SByte>, IEquatable<SByte>
	{
		public const sbyte MaxValue = 127;
		public const sbyte MinValue = -128;

		[DummyPrimitiveField]
		private sbyte ff;

		public int CompareTo(object o)
		{
			if(!(o is SByte))
				Environment.Exit(1);

			return PrimitiveHelper.DoCompareOpIntegral(this, (SByte)o);
		}

		public int CompareTo(SByte sb)
		{ return PrimitiveHelper.DoCompareOpIntegral(this, sb); }

		public new bool Equals(object o)
		{ return (o is SByte) && (this == ((SByte)o)); }

		public bool Equals(SByte sb)
		{ return this == sb; }

		public new int GetHashCode()
		{ return (((sbyte)this) ^ (((sbyte)this) << 8)); }

		public static sbyte Parse(string sv)
		{ return (sbyte)PrimitiveHelper.ParseIntegral(sv); }

		public override string ToString()
		{ return PrimitiveHelper.IntegralToString(this); }
	}
}

#pragma warning restore 0169

